<%--
    Document   : category
    Created on : Mar 30, 2011, 11:26:29 PM
    Author     : Nguyen Hung
--%>

<%@page import="java.text.NumberFormat"%>
<%@page import="Business.Product"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@include file="WEB-INF/jspf/header.jspf" %>
 <div class="borderheader"><font color="##330000" size="+1"> Kết quả tìm kiếm :</font><br></div>
<%
            ArrayList<Product> products = (ArrayList<Product>) request.getAttribute("products");
            int pagen = (Integer) request.getAttribute("pagen");
            //int pagen = (Integer) request.getAttribute("pagen");
            NumberFormat nf = NumberFormat.getInstance();
            //nf.setMinimumFractionDigits(2);
            nf.setMaximumFractionDigits(2);
            String vendor = (String)session.getAttribute("vendor");
            String keyword = (String) session.getAttribute("keyword");
             String h1 = (String)request.getAttribute("h1");
             if(h1 != null){
%>
<%=h1%>
<%}%>

<div class="box_bd" >
    <%
                for (Product product : products) {

    %>

 
    <div id="box">
     <table width="100%" align="center" border="1">
     <tr>
     <td width="100%" align="center">
         <a href="tooltipchosanpham.jsp?productId=<%=product.getProductCode()%>" name="<%=product.getVendor()%>" id="<%=product.getProductCode()%>" class="jTip"><img src="<%=product.getImage()%>" width="190" height="130" alt="<%=product.getVendor() + " "%>" ></a>
    <div class="tensanpham"><a href="SeeMoreServlet?productCode=<%=product.getProductCode()%>">LAPTOP <%=product.getVendor() + " " + product.getProductCode()%></a></div>
    <div class="chitiet"><%=nf.format(product.getPrice())%> VNĐ</div>
    <div class="thongtin"><a href="SeeMoreServlet?productCode=<%=product.getProductCode()%>"><img src="images/design/chitiet_1.jpg"></a></div>

    <div class="dathang"><a href="cart?productCode=<%=product.getProductCode()%>"><img src="images/design/datmua_1.jpg"></a></div>
    </td>
    </tr>
    </table>
</div>
    <%
                }
    %>
</div>
    <div class="phantrang" align="center">
<%
    for(int i = 1; i <= pagen; i++){

%>
<a href="CategoryServlet?vendor=<%=vendor%>&keyword=<%=keyword%>&pagenumber=<%=i%>"><%=i%></a>
<%
}
%>
</div>
    
<%@include file="WEB-INF/jspf/footer.jspf" %>  

